home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_319 / cnewssrc / cnews.orig.lzh / batch / Makefile < prev    next >
Makefile  |  1989-06-27  |  5KB  |  169 lines

  1. # Configuration stuff.
  2. COPTS=-O
  3. CFLAGS=$(COPTS) -I../include
  4. LDFLAGS=
  5. LIBS=../libcnews.a
  6. # =()<NEWSARTS = @<NEWSARTS>@>()=
  7. NEWSARTS = /usr/spool/news
  8. # =()<NEWSBIN = @<NEWSBIN>@>()=
  9. NEWSBIN = /usr/lib/newsbin
  10. # =()<NEWSCTL = @<NEWSCTL>@>()=
  11. NEWSCTL = /usr/lib/news
  12. # workaround for System V make bug
  13. SHELL = /bin/sh
  14.  
  15. OUTGOING = $(NEWSARTS)/out.going
  16. PGMDIR = $(NEWSBIN)/batch
  17.  
  18. PGMS=batcher batchih batchsm batchsplit comp compcun nocomp viainews viauux \
  19.     sendbatches compc7 c7encode viamail viapmail bencode compb
  20. DTR=Makefile batcher.c batchih batchsplit c7encode.c comp compc7 compcun \
  21.     newsbatch.8 nocomp sendbatches viainews viauux viamail \
  22.     bencode.c coder.h crctab.c compb viapmail
  23. ALL = $(PGMS) batchparms
  24.  
  25. all:    $(ALL)
  26.     chmod +x $(PGMS)
  27.  
  28. batcher:    batcher.o $(LIBS)
  29.     $(CC) $(CFLAGS) $(LDFLAGS) batcher.o $(LIBS) -o $@
  30.  
  31. c7encode:    c7encode.o $(LIBS)
  32.     $(CC) $(CFLAGS) $(LDFLAGS) c7encode.o $(LIBS) -o $@
  33.  
  34. bencode:    bencode.o crctab.o $(LIBS)
  35.     $(CC) $(CFLAGS) bencode.o crctab.o $(LIBS) -o $@
  36.  
  37. bencode.o:    coder.h
  38.  
  39. bininstall:    all
  40.     -if test ! -d $(PGMDIR) ; then mkdir $(PGMDIR) ; fi
  41.     cp $(PGMS) $(PGMDIR)
  42.  
  43. newsinstall:    batchparms
  44.     -if test ! -d $(OUTGOING) ; then mkdir $(OUTGOING) ; fi
  45.     -if test ! -r $(NEWSCTL)/batchparms ; then cp batchparms $(NEWSCTL) ; fi
  46.  
  47. batchparms:    Makefile
  48.     echo '# 100KB, after compress, is 10 minutes at 1200 baud' >$@
  49.     echo '# 20 batches is somewhat arbitrary, about 1MB per site' >>$@
  50.     echo '# defaults:  2.11-compatible compression, transfer by uux' >>$@
  51.     echo '#' >>$@
  52.     echo '# site        size    queue    builder    muncher    sender' >>$@
  53.     echo '# ----        ----    -----    -------    -------    ------' >>$@
  54.     echo '/default/    100000    20    batcher    compcun    viauux' >>$@
  55.     echo '#' >>$@
  56.     echo '# sample ihave/sendme setup' >>$@
  57.     echo 'louie.ihave    100000    20    batchih    nocomp    viainews' >>$@
  58.     echo 'louie.sendme    100000    20    batchsm    nocomp    viainews' >>$@
  59.  
  60. batchsm:    batchih
  61.     sed 's/ihave/sendme/g' batchih >$@
  62.  
  63. test.1:
  64.     echo 'a test' >$@
  65.  
  66. test.2:
  67.     echo 'another test' >$@
  68.  
  69. test.3:
  70.     cat batcher.c batcher.c batcher.c batcher.c batcher.c >$@
  71.  
  72. r:    all test.1 test.2 test.3
  73.     echo a 1 >togo
  74.     echo b 1 >>togo
  75.     echo c 1 >>togo
  76.     echo d 1 >>togo
  77.     echo e 1 >>togo
  78.     echo f 1 >>togo
  79.     echo g 1 >>togo
  80.     echo h 3 >>togo
  81.     echo i 20 >>togo
  82.     echo j 999 >>togo
  83.     rm -rf bin
  84.     mkdir bin
  85.     echo 'ln $$* >/dev/null 2>/dev/null' >bin/newslock
  86.     echo 'cat $*' >bin/munch
  87.     echo '( echo --- ; cat $* ) >>output' >bin/xmit
  88.     echo 'echo 2 ; cat $*' >bin/munch2
  89.     echo '( echo +++ ; cat $* ) >>output' >bin/xmit2
  90.     echo 'echo 4' >bin/queuelen
  91.     echo 'echo 99' >bin/spacefor
  92.     ln batcher bin/batcher
  93.     ln batchsplit bin/batchsplit
  94.     chmod +x bin/*
  95.     NEWSCTL=`pwd` ./batchsplit 1
  96.     echo a 1 >test.good ; cmp test.good togo.1
  97.     echo b 1 >test.good ; cmp test.good togo.2
  98.     echo c 1 >test.good ; cmp test.good togo.3
  99.     echo d 1 >test.good ; cmp test.good togo.4
  100.     echo e 1 >test.good ; cmp test.good togo.5
  101.     echo f 1 >test.good ; cmp test.good togo.6
  102.     echo g 1 >test.good ; cmp test.good togo.7
  103.     echo h 3 >test.good ; echo i 20 >>test.good ; cmp test.good togo.next
  104.     echo j 999 >test.good ; cmp test.good togo
  105.     rm togo.*
  106.     echo `pwd`/test.1 >togo
  107.     echo ./test.2 >>togo
  108.     echo `pwd`/test.3 666 >>togo
  109.     ./batcher togo >test.out
  110.     echo "#! rnews `wc -c test.1 | awk '{print $$1}'`" >test.good
  111.     cat test.1 >>test.good
  112.     echo "#! rnews `wc -c test.2 | awk '{print $$1}'`" >>test.good
  113.     cat test.2 >>test.good
  114.     ( echo --- ; cat test.good ) >test.out1
  115.     ( echo +++ ; echo 2 ; cat test.good ) >test.out2
  116.     echo "#! rnews `wc -c test.3 | awk '{print $$1}'`" >test.temp
  117.     cat test.3 >>test.temp
  118.     cat test.temp >>test.good
  119.     ( echo --- ; cat test.temp ) >>test.out1
  120.     cmp test.good test.out
  121.     ./batcher -d `pwd` togo >test.out
  122.     cmp test.good test.out
  123.     rm test.out togo
  124.     rm -rf out.going batchparms test.out test.good
  125.     mkdir out.going out.going/foo out.going/bar
  126.     echo 'foo    500    10    batcher    munch    xmit' >batchparms
  127.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./sendbatches -d >test.out
  128.     echo foo >test.good
  129.     cmp test.out test.good
  130.     echo '/default/    10000    5    batcher    munch2    xmit2' >>batchparms
  131.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./sendbatches -d | sort >test.out
  132.     ( echo foo ; echo bar ) | sort >test.good
  133.     cmp test.out test.good
  134.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./sendbatches -d bletch >test.out
  135.     echo bletch >test.good
  136.     cmp test.out test.good
  137.     >batchlog
  138.     >batchlog.o
  139.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./sendbatches
  140.     test ! -s out.going/foo/output
  141.     test ! -s out.going/bar/output
  142.     echo `pwd`/test.1 200 >out.going/foo/togo
  143.     echo `pwd`/test.2 200 >>out.going/foo/togo
  144.     echo `pwd`/test.3 200 >>out.going/foo/togo
  145.     echo `pwd`/test.1 4000 >out.going/bar/togo
  146.     echo `pwd`/test.2 4000 >>out.going/bar/togo
  147.     echo `pwd`/test.3 4000 >>out.going/bar/togo
  148.     echo `pwd`/test.3 4000 >test.left
  149.     NEWSARTS=`pwd` NEWSCTL=`pwd` ./sendbatches
  150.     cmp out.going/foo/output test.out1
  151.     cmp out.going/bar/output test.out2
  152.     test ! -s out.going/foo/togo
  153.     test ! -s out.going/bar/togo
  154.     cmp test.left out.going/bar/togo.2
  155.     sed 1d batchlog.o >test.log
  156.     test ! -s test.log
  157.     sed 1d batchlog >test.log
  158.     echo 'bar    backlog 1 (batches flowing)' >test.good
  159.     cmp test.good test.log
  160.     rm -rf test.* togo out.going bin batchparms batchlog batchlog.*
  161.  
  162. dtr:    $(DTR)
  163.     makedtr $(DTR) >$@
  164.  
  165. clean:
  166.     rm -rf out.going bin
  167.     rm -f *.o test.* togo togo.* batchparms batcher batchsm 
  168.     rm -f batchlog batchlog.* c7encode bencode
  169.